/*
进度条
*/

layui.define(['element','scene'], function (exports) {
    let $ = layui.jquery,element = layui.element,scene = layui.scene;

    let max=1,num=0;
    function progress() {
        max = arguments[0]||1;
        return null;
    }

    progress.add = function () {
        setProgress(arguments[0]);
    }

    function setProgress() {
        num += parseInt(arguments[0]);
        let pn = num / max * 100;
        let p = String(pn) + '%';
        element.progress('progress', p);
    }

    exports('progress', progress);
})